/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_effect_visitor.h

	$Header: /heroes4/artifact_effect_visitor.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_EFFECT_VISITOR_H_INCLUDED )
#define ARTIFACT_EFFECT_VISITOR_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class t_artifact;
class t_artifact_effect;

namespace t_artifact_prop
{
	class t_aligned_bonus_base;
	class t_combat;
	class t_damage_bonus_base;
	class t_creature_growth;
	class t_give_ability;
	class t_income;
	class t_movement;
	class t_single_spell;
	class t_skill_effect;
	class t_spell_with_attack_base;
	class t_spell_charges_base;
	class t_spell_cost_base;
	class t_spell_list_effect;
};

// ----------------------------------------------------------------
// abstract base class which performs some operation on each artifact effect
// ----------------------------------------------------------------
class t_artifact_effect_visitor
{
public:
	t_artifact_effect_visitor();
	virtual ~t_artifact_effect_visitor();

	t_artifact const*	get_artifact() const;
	void				set_artifact( t_artifact const* artifact );
	virtual bool		visit( t_artifact_effect& effect );
	virtual bool		visit_ability( t_artifact_prop::t_give_ability& effect );
	virtual bool		visit_aligned_bonus( t_artifact_prop::t_aligned_bonus_base& effect );
	virtual bool		visit_combat( t_artifact_prop::t_combat& effect );
	virtual bool		visit_damage( t_artifact_prop::t_damage_bonus_base& effect );
	virtual bool		visit_growth( t_artifact_prop::t_creature_growth& effect );
	virtual bool		visit_income( t_artifact_prop::t_income& effect );
	virtual bool		visit_movement( t_artifact_prop::t_movement& effect );
	virtual bool		visit_skill( t_artifact_prop::t_skill_effect& effect );
	virtual bool		visit_spell( t_artifact_prop::t_single_spell& effect );
	virtual bool		visit_spell_attack( t_artifact_prop::t_spell_with_attack_base& effect );
	virtual bool		visit_spell_charges( t_artifact_prop::t_spell_charges_base& effect );
	virtual bool		visit_spell_cost( t_artifact_prop::t_spell_cost_base& effect );
	virtual bool		visit_spell_list( t_artifact_prop::t_spell_list_effect& effect );
protected:
	t_artifact const* m_artifact;
};

inline t_artifact_effect_visitor::t_artifact_effect_visitor()
{
	m_artifact = 0;
}

inline t_artifact const* t_artifact_effect_visitor::get_artifact() const
{
	return m_artifact;
}

inline void t_artifact_effect_visitor::set_artifact( t_artifact const* artifact )
{
	m_artifact = artifact;
}

#endif // ARTIFACT_EFFECT_VISITOR_H_INCLUDED